<%@ page import="java.util.List" %>

<%@ taglib uri="/WEB-INF/bpmapp.tld" prefix="ssp" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<% String ctPath = request.getContextPath(); %>

<jsp:useBean id="bv_user_logged_in" scope="session" class="java.lang.String" />

<logic:equal name="bv_user_logged_in" value="true">

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="app_pageTitle">
        <span class="left"><bean:message bundle="appCommonRes" key="bp.alerts.allAlertsInbox" /></span>
      </div>

      <div class="app_pageSubtitle">
        <span class="left"><bean:message  bundle="appCommonRes" key="bp.alerts.allAlertsInbox"/></span>
      </div>
      
			<div class="blockWrap">
			
      <table width="100%" class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="<bean:message bundle="appCommonRes" key="bp.alerts.table.summary"/>">
        <tr class="listHeader">
          <th id="Subject" align="left">
            <b><bean:message bundle="appCommonRes" key="bp.alerts.subject"/></b>
          </th>
          <th id="Received" align="left">
            <b><bean:message bundle="appCommonRes" key="bp.alerts.received"/></b>
          </th>
          <th id="Action" align="left">
            <b><bean:message bundle="appCommonRes" key="bp.alerts.action"/></b>
          </th>
        </tr>

<ssp:queryAlert id="alertList" type="all" displayType="ALL_ALERTS_HOME"/>

<logic:iterate id="alertItem" name="alertList" indexId="index">

        <tr class="<%=index.intValue() % 2 == 0? "listEven" : "listOdd" %>" >
          <td headers="Subject">
            <a href = "<bean:write name='alertItem' property = 'viewURL' />&selectedMenuId=4" >
              <bean:write name="alertItem" property = "subject"  />
            </a>
          </td>
  
          <td headers="Received">
            <bean:write name="alertItem" property ="creationDate" formatKey="format.datetime.short" />
          </td>
  
          <td headers="Action">
            <a href = "<bean:write name='alertItem' property = 'deleteURL' />&selectedMenuId=4" > 
              <img src="<%= ctPath %>/ca/images/action/icon_delete.gif" class="actionIcon" border="0" alt="<bean:message key="cs.image.alt.delete"/>" title="<bean:message key="cs.image.alt.delete"/>"> 
            </a>
          </td>
  
        </tr>

</logic:iterate>

    <%
         int numAlerts = ((List)pageContext.getAttribute("alertList")).size();
         if (numAlerts <= 0)
         {
      %>
      <tr class="listOdd">
        <td colspan="3" align="center">
        <bean:message bundle="appCommonRes" key="bp.alerts.noAlerts" />
        </td>
      </tr>
    <%
         }
    %>

      </table>

</logic:equal>
    </div>
    </td>
  </tr>
</table>
